In [2]:
7**4+4


Out[2]:
2405

In [1]:
5+7**5


Out[1]:
16812

Problem 1

Test whether the series is convergent or divergent:

$$\sum_{n=1}^{\infty} \frac{1}{n+7^n}$$

In [8]:
import sympy as sp
from matplotlib import pyplot as plt

%matplotlib inline

# Customize figure size
plt.rcParams['figure.figsize'] = 25, 15
#plt.rcParams['lines.linewidth'] = 1
#plt.rcParams['lines.color'] = 'g'
plt.rcParams['font.family'] = 'monospace'
plt.rcParams['font.size'] = '16.0'
plt.rcParams['text.hinting'] = 'either'

f = lambda x: 1/(x + 7**x)

sp.mpmath.plot([f], xlim=[-5,25], ylim=[0,25], points=500)

# To check your work, use Sympy.mpmath.nsum()
# This gives the sum of the infinite series (if the series converges)
infty = sp.mpmath.inf
sum = sp.mpmath.nsum(f, [1, infty])
print('The sum of the series = {}'.format(sum))


The sum of the series = 0.147983214345338

Let $a_n = \sum_{n=1}^{\infty} \frac{1}{n + 7^n}$.

Could $a_n$ be a Combination of Series (i.e. the sum of two series)?


In [9]:
f = lambda x: 1/x
g = lambda x: 1/7**x

sp.mpmath.plot([f,g], xlim=[-5,25], ylim=[0,25], points=500)

# Check that sum of f_n plus g_n = a_n
sum = sp.mpmath.nsum(f, [1, infty]) + sp.mpmath.nsum(g, [1, infty])
print('The sum of the series = {}'.format(sum))


The sum of the series = 9.63004876560769

In [ ]: